<template>
  <div class="semereport">
    <div class="maodian">
      <a :class="maodianIndex == index ? 'maoaactive' : 'maoa'" :href="value.href" v-for="(value, index) in maodianList"
        :key="value.id" @click="clickMaodain(index)">{{ value.name }}</a>
    </div>
    <div id="print1" class="water-mark-wrap" ref="printshuiyin">
      <h2 style="padding-top:20px;font-size:32px !important;font-weight:bold !important;text-align: center;">
        {{ title }}学生发展质量报告
      </h2>
      <div class="flex" id="mao1" style="font-size:18px;padding:0px">
        <div>
          县(区、市) ：<span style="font-weight:700;">{{ myself.dz || '' }}</span>
        </div>
        <div>
          学校：<span style="font-weight:700;">{{
            myself.schoolname
          }}</span>
        </div>
      </div>
      <h2 style="text-align: left;">一 、基本信息</h2>
      <!-- 这是表格 -->
      <table ref="" class="basetable"
        style="width:100%; border-collapse:collapse;border: 1px solid #6d6c6c;table-layout:fixed;margin-bottom:-1px;height: 100%;">
        <tr>
          <td colspan="4" class="tablecenter">姓名</td>
          <td colspan="4" class="tablecenter whitebold">{{ myself.xm || '' }}</td>
          <td colspan="4" class="tablecenter ">性别</td>
          <td colspan="5" class="tablecenter whitebold">
            {{ myself.xbm == 1 ? '男' : '女' }}
          </td>
          <td colspan="5" rowspan="5" class="tablecenter" style="width: 150px;">
            <img v-show="imgshow" width="90" height="120" :src="imgurl" />
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">曾用名</td>
          <td colspan="4" class="tablecenter whitebold">
            {{ myself.cym || '' }}
          </td>
          <td colspan="4" class="tablecenter ">出生日期</td>
          <td colspan="5" class="tablecenter whitebold">
            {{ myself.csrq || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">民族</td>
          <td colspan="4" class="tablecenter whitebold">{{ myself.mz || '' }}</td>
          <td colspan="4" class="tablecenter ">政治面貌</td>
          <td colspan="5" class="tablecenter whitebold">
            {{ myself.zzmm || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">证件类型</td>
          <td colspan="4" class="tablecenter whitebold">
            {{ myself.sfzjlx || '' }}
          </td>
          <td colspan="4" class="tablecenter  ">证件号码</td>
          <td colspan="5" class="tablecenter whitebold">
            {{ myself.sfzjh || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">国籍地区</td>
          <td colspan="4" class="tablecenter whitebold">
            {{ myself.gjdq || '' }}
          </td>
          <td colspan="4" class="tablecenter ">港澳台侨外</td>
          <td colspan="5" class="tablecenter whitebold">
            {{ myself.gatqw || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">年级</td>
          <td colspan="4" class="tablecenter whitebold">
            {{ myself.gradename || '' }}
          </td>
          <td colspan="4" class="tablecenter ">班级</td>
          <td colspan="10" class="tablecenter whitebold">
            {{ myself.classname || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="8" class="tablecenter ">现居住详情地址</td>
          <td colspan="14" class="tableleft whitebold">{{ myself.xzz || '' }}</td>
        </tr>
        <tr>
          <td colspan="8" class="tablecenter ">户口所在地具体地址</td>
          <td colspan="14" class="tableleft whitebold">
            {{ myself.txdz || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">是否寄宿生</td>
          <td colspan="4" class="tablecenter whitebold">
            {{ myself.sfjssm == 0 ? '否' : '是' || '' }}
          </td>
          <td colspan="5" class="tablecenter ">是否留守儿童</td>
          <td colspan="9" class="tablecenter whitebold">
            {{ myself.sflset || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">是否残疾人</td>
          <td colspan="4" class="tablecenter whitebold">
            {{ myself.cjlx ? '是' : '否' || '' }}
          </td>
          <td colspan="5" class="tablecenter ">入学方式</td>
          <td colspan="9" class="tablecenter whitebold">
            {{ myself.rxfs || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">残疾类型</td>
          <td colspan="4" class="tablecenter whitebold">
            {{ myself.cjlx || '' }}
          </td>
          <td colspan="5" class="tablecenter ">特殊学生就读类型</td>
          <td colspan="9" class="tablecenter"></td>
        </tr>
        <tr>
          <td colspan="8" class="tablecenter ">入学前学校</td>
          <td colspan="14" class="tableleft whitebold">
            {{ myself.priorschool || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="8" class="tablecenter ">出生地</td>
          <td colspan="14" class="tableleft whitebold">
            {{ myself.xzqh || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="8" class="tablecenter ">特长</td>
          <td colspan="14" class="tableleft whitebold">
            {{ myself.xstc || '' }}
          </td>
        </tr>
        <tr>
          <td colspan="22" class="tablecenter">家庭成员</td>
        </tr>
      </table>

      <!-- 这是家庭成员 -->
      <table ref="" class="basetable toptable" v-show="myself.familycon.length == 0" style="width:100%; border-collapse:collapse;
            border: 1px solid #6d6c6c;table-layout:fixed;
            margin-bottom:-1px;height: 100%;border-bottom:0px;border-top:0px solid red !important;"
        v-for="(value, index) in myself.familycon" :key="'family-' + index">
        <tr style="border-top:0px solid red !important;" class="trr">
          <td style="border-top:0px solid red !important;" colspan="5" class="tablecenter tdd">
            姓名
          </td>
          <td style="border-top:0px solid red !important;" colspan="6" class="tablecenter tdd whitebold">
            {{ value.CYXM }}
          </td>
          <td style="border-top:0px solid red !important;" colspan="5" class="tablecenter tdd">
            关系
          </td>
          <td style="border-top:0px solid red !important;" colspan="6" class="tablecenter tdd whitebold">
            {{ value.GXM }}
          </td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter width200">是否监护人</td>
          <td colspan="6" class="tablecenter whitebold">
            {{ value.SFJHRM }}
          </td>
          <td colspan="5" class="tablecenter width200">民族</td>
          <td colspan="6" class="tablecenter whitebold">{{ value.MZM }}</td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter width200">证件类型</td>
          <td colspan="6" class="tablecenter whitebold">
            {{ value.SFZJLXM }}
          </td>
          <td colspan="5" class="tablecenter width200">证件号码</td>
          <td colspan="6" class="tablecenter whitebold">
            {{ value.SFZJH }}
          </td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter width200">联系电话</td>
          <td colspan="17" class="tablecenter whitebold">
            {{ value.LXDH }}
          </td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter width200">工作单位</td>
          <td colspan="17" class="tablecenter whitebold">
            {{ value.GZDW }}
          </td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter width200">户口所在地具体地址</td>
          <td colspan="17" class="tablecenter whitebold">
            {{ value.HKSZD }}
          </td>
        </tr>
      </table>

      <table ref="" v-show="myself.familycon.length == 0" class="basetable toptable" style="width:100%; border-collapse:collapse;
            border: 1px solid #6d6c6c;table-layout:fixed;
            margin-bottom:-1px;height: 50%;" v-for="(value, index) in 2" :key="'empty-family-' + index">
        <tr style="border-top:0px solid #ccc;" class="trr">
          <td colspan="5" class="tablecenter tdd width200">姓名</td>
          <td colspan="6" class="tablecenter tdd"></td>
          <td colspan="5" class="tablecenter tdd width100">关系</td>
          <td colspan="6" class="tablecenter tdd"></td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter ">是否监护人</td>
          <td colspan="6" class="tablecenter"></td>
          <td colspan="5" class="tablecenter ">民族</td>
          <td colspan="6" class="tablecenter"></td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter ">证件类型</td>
          <td colspan="6" class="tablecenter"></td>
          <td colspan="5" class="tablecenter ">证件号码</td>
          <td colspan="6" class="tablecenter"></td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter ">联系电话</td>
          <td colspan="17" class="tablecenter"></td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter ">工作单位</td>
          <td colspan="17" class="tablecenter"></td>
        </tr>
        <tr>
          <td colspan="5" class="tablecenter ">户口所在地具体地址</td>
          <td colspan="17" class="tablecenter"></td>
        </tr>
      </table>

      <div class="printPagenext" style="page-break-after:always"></div>
      <!-- 学习简历 -->
      <table ref="" class="basetable toptable" style="width:100%; border-collapse:collapse;
            border: 1px solid #6d6c6c;table-layout:fixed;
            margin-bottom:-2px;height: 100%;border-bottom:0px;border-top:0px solid red !important;">
        <tr style="border-top:0px solid red !important;">
          <td style="border-top:1px solid gray !important;" colspan="22" class="tablecenter ">
            学习简历
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">开始日期</td>
          <td colspan="4" class="tablecenter ">结束日期</td>
          <td colspan="5" class="tablecenter ">所在学校</td>
          <td colspan="5" class="tablecenter ">担任职务</td>
          <td colspan="4" class="tablecenter ">证明人</td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[0] && myself.resumecon[0].XXQSRQ
                ? myself.resumecon[0].XXQSRQ
                : '&nbsp;'
            }}
          </td>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[0] && myself.resumecon[0].XXZZRQ
                ? myself.resumecon[0].XXZZRQ
                : ''
            }}
          </td>
          <td colspan="5" class="tablecenter whitebold">
            {{
              myself.resumecon[0] && myself.resumecon[0].XXDW
                ? myself.resumecon[0].XXDW
                : ''
            }}
          </td>
          <td colspan="5" class="tablecenter whitebold">
            {{
              myself.resumecon[0] && myself.resumecon[0].DZZW
                ? myself.resumecon[0].DZZW
                : ''
            }}
          </td>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[0] && myself.resumecon[0].XXZMR
                ? myself.resumecon[0].XXZMR
                : ''
            }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[1] && myself.resumecon[1].XXQSRQ
                ? myself.resumecon[1].XXQSRQ
                : '&nbsp;'
            }}
          </td>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[1] && myself.resumecon[1].XXZZRQ
                ? myself.resumecon[1].XXZZRQ
                : ''
            }}
          </td>
          <td colspan="5" class="tablecenter whitebold">
            {{
              myself.resumecon[1] && myself.resumecon[1].XXDW
                ? myself.resumecon[1].XXDW
                : ''
            }}
          </td>
          <td colspan="5" class="tablecenter whitebold">
            {{
              myself.resumecon[1] && myself.resumecon[1].DZZW
                ? myself.resumecon[1].DZZW
                : ''
            }}
          </td>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[1] && myself.resumecon[1].XXZMR
                ? myself.resumecon[1].XXZMR
                : ''
            }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[2] && myself.resumecon[2].XXQSRQ
                ? myself.resumecon[2].XXQSRQ
                : '&nbsp;'
            }}
          </td>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[2] && myself.resumecon[2].XXZZRQ
                ? myself.resumecon[2].XXZZRQ
                : ''
            }}
          </td>
          <td colspan="5" class="tablecenter whitebold">
            {{
              myself.resumecon[2] && myself.resumecon[2].XXDW
                ? myself.resumecon[2].XXDW
                : ''
            }}
          </td>
          <td colspan="5" class="tablecenter whitebold">
            {{
              myself.resumecon[2] && myself.resumecon[2].DZZW
                ? myself.resumecon[2].DZZW
                : ''
            }}
          </td>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.resumecon[2] && myself.resumecon[2].XXZMR
                ? myself.resumecon[2].XXZMR
                : ''
            }}
          </td>
        </tr>

        <!-- 异动变更信息 -->
        <tr>
          <td colspan="22" class="tablecenter ">异动变更记录</td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter ">异动类型</td>
          <td colspan="6" class="tablecenter ">时间</td>
          <td colspan="12" class="tablecenter ">异动内容</td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.yidong[0] && myself.yidong[0].ydlb
                ? myself.yidong[0].ydlb
                : '&nbsp;'
            }}
          </td>
          <td colspan="6" class="tablecenter whitebold">
            {{
              myself.yidong[0] && myself.yidong[0].applydate
                ? myself.yidong[0].applydate
                : ''
            }}
          </td>
          <td colspan="12" class="tablecenter whitebold">
            {{
              myself.yidong[0] && myself.yidong[0].reason
                ? myself.yidong[0].reason
                : ''
            }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.yidong[1] && myself.yidong[1].ydlb
                ? myself.yidong[1].ydlb
                : '&nbsp;'
            }}
          </td>
          <td colspan="6" class="tablecenter whitebold">
            {{
              myself.yidong[1] && myself.yidong[1].applydate
                ? myself.yidong[1].applydate
                : ''
            }}
          </td>
          <td colspan="12" class="tablecenter whitebold">
            {{
              myself.yidong[1] && myself.yidong[1].reason
                ? myself.yidong[1].reason
                : ''
            }}
          </td>
        </tr>
        <tr>
          <td colspan="4" class="tablecenter whitebold">
            {{
              myself.yidong[2] && myself.yidong[2].ydlb
                ? myself.yidong[2].ydlb
                : '&nbsp;'
            }}
          </td>
          <td colspan="6" class="tablecenter whitebold">
            {{
              myself.yidong[2] && myself.yidong[2].applydate
                ? myself.yidong[2].applydate
                : ''
            }}
          </td>
          <td colspan="12" class="tablecenter whitebold">
            {{
              myself.yidong[2] && myself.yidong[2].reason
                ? myself.yidong[2].reason
                : ''
            }}
          </td>
        </tr>
        <!-- 自我介绍 -->
        <tr style="min-height:160px;height:140px !important;">
          <td colspan="3" class="tablecenter ">自我介绍</td>
          <td colspan="19" class="tableleft whitebold" style="padding-top:10px;vertical-align:baseline;">
            {{ myself.statement }}
          </td>
        </tr>
        <tr style="min-height:160px;height:140px !important;;">
          <td colspan="3" class="tablecenter ">班主任评语</td>
          <td colspan="19" class="tableleft whitebold"
            style="padding-top:10px;vertical-align:baseline;word-break:break-all;">
            {{ myself.cevaluation }}
          </td>
        </tr>
      </table>

      <div class="printPagenext" style="page-break-after:always"></div>
      <h2 style="text-align: left;margin-top:20px;" id="mao2">
        二 、综合素质发展记录
      </h2>

      <!-- 动态便利生成新报告 -->
      <div class="paolu" v-for="(item, index) in newDta" :key="index">
        <!-- 每次大指标都分页 -->
        <div class="printPagenext" v-if="index == 0" id="mao2">

        </div>

        <div class="printPagenext" v-else style="page-break-after:always" :id="'mao' + (index + 2)">

        </div>
        <h3 class="font18" style="margin-top:20px !important;">
          （{{
            index == 0
              ? '一'
              : index == 1
                ? '二'
                : index == 2
                  ? '三'
                  : index == 3
                    ? '四'
                    : index == 4
                      ? '五'
                      : index == 5
                        ? '六'
                        : index == 6
                          ? '七'
                          : '八'
          }}）{{ item.name }}
        </h3>
        <!-- 如果是学业发展，那么底下先出学业发展的报告 -->
        <div class="kechengxiuxi"  v-if="item.name == '学业发展'">
          <h3 style="font-size: 18px;">1.课程修习情况</h3>
          <table ref="" class="basetable"
            style="width:100%; border-collapse:collapse;border: 1px solid #6d6c6c;table-layout:fixed;margin-bottom:10px;height: 100%;">
            <tr>
              <td colspan="2" rowspan="2" class="tablecenter ">科目</td>
              <td colspan="12" class="tablecenter ">{{ njdata }}</td>
            </tr>
            <tr>
              <td colspan="6" class="tablecenter width200">上学期</td>
              <td colspan="6" class="tablecenter ">下学期</td>
            </tr>
            <tr v-for="(item, index) in km" :key="index">
              <td colspan="2" class="tablecenter  width200">{{ item.TEXT }}</td>
              <td colspan="6" class="tablecenter ">
                {{
                  allsem.score211 && allsem.score211[item.CODE]
                    ? allsem.score211[item.CODE]
                    : ''
                }}
              </td>
              <td colspan="6" class="tablecenter ">
                {{
                  allsem.score212 && allsem.score212[item.CODE]
                    ? allsem.score212[item.CODE]
                    : ''
                }}
              </td>
            </tr>
            <tr>
              <td colspan="2" class="tablecenter  width200">成绩呈现说明</td>
              <td colspan="12" class="tablecenter"></td>
            </tr>
          </table>

          <div class="printPagenext" style="page-break-after:always"></div>
        </div>
        <!-- 如果是身心健康的话，出体检报告和体测报告 -->
        <div class="shenxinjiankang"  v-if="item.name == '身心发展'">
          <h3 style="font-size: 18px;">
            1.表：《国家学生体质健康标准》登记卡
          </h3>
          <table ref="" class="basetable"
            style="width:100%; border-collapse:collapse;border: 1px solid #6d6c6c;table-layout:fixed;margin-bottom:10px;height: 100%;">
            <tr>
              <td class="tablecenter" colspan="2">姓名</td>
              <td class="tablecenter whitebold" colspan="2">
                {{ myself.xm }}
              </td>
              <td class="tablecenter" colspan="2">
                性别
              </td>
              <td class="tablecenter whitebold" colspan="2">
                {{ myself.xbm == 1 ? '男' : '女' }}
              </td>
              <td class="tablecenter" colspan="2">学生标识码</td>
              <td class="tablecenter whitebold" colspan="2">
                {{ listrow.xsbsm }}
              </td>
            </tr>
            <tr>
              <td class="tablecenter " colspan="2">班级</td>
              <td class="tablecenter whitebold" colspan="2">
                {{ myself.classname }}
              </td>
              <td class="tablecenter " colspan="2">民族</td>
              <td class="tablecenter whitebold" colspan="2">
                {{ myself.mz }}
              </td>
              <td class="tablecenter " colspan="2">出生日期</td>
              <td class="tablecenter whitebold" colspan="2">
                {{ myself.csrq }}
              </td>
            </tr>
            <tr>
              <td class="tablecenter " colspan="3">单项指标</td>
              <td class="tablecenter " colspan="9">{{ njdata }}</td>
            </tr>

            <tr>
              <td class="tablecenter" colspan="3"></td>
              <td class="tablecenter " colspan="3">成绩</td>
              <td class="tablecenter " colspan="3">得分</td>
              <td class="tablecenter " colspan="3">等级</td>
            </tr>

            <template v-if="table6.length > 0">
              <tr v-for="(value, index) in table6" :key="index">
                <td class="tablecenter " colspan="3">
                  {{ value.text }}({{ value.jldw }})
                </td>
                <td class="tablecenter whitebold" colspan="3" v-if="njdata == '小学一年级'">
                  {{ value.cj11 }}
                </td>
                <!-- 其他年级条件省略 -->
              </tr>
            </template>
            <!-- 省略了其他体测表格内容 -->
          </table>

          <!-- 中学生体检表 -->
          <div class="printPagenext" style="page-break-after:always"></div>
          <h3 style="font-size: 18px;">2.中学生健康体检表</h3>
          <table ref="" class="basetable"
            style="width:100%;margin-top:10px !important; border-collapse:collapse;border: 1px solid #6d6c6c;table-layout:fixed;margin-bottom:10px;height: 100%;">
            <tr>
              <td colspan="6" class="tablecenter slash-wrap " style="height:30px;">
                <!-- <span class="left ">项目</span>
                      <span class="slash"></span>
                      <span class="right ">学年</span> -->
                项目 <span style="font-weight: 400;"> \ </span> 学年
              </td>
              <td colspan="12" class="tablecenter">{{ njdata }}</td>
              <!-- <td colspan="4" class="tablecenter">初二年级</td>
                    <td colspan="4" class="tablecenter">初三年级</td> -->
            </tr>
            <tr v-for="(item, index) in selsche1.base" :key="index">
              <td colspan="6" class="tablecenter  ">
                {{ item.text }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学一年级'">
                {{ item.tjjg11 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学二年级'">
                {{ item.tjjg12 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学三年级'">
                {{ item.tjjg13 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学四年级'">
                {{ item.tjjg14 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学五年级'">
                {{ item.tjjg15 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学六年级'">
                {{ item.tjjg16 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中一年级'">
                {{ item.tjjg31 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中二年级'">
                {{ item.tjjg32 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中三年级'">
                {{ item.tjjg33 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中一年级'">
                {{ item.tjjg21 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中二年级'">
                {{ item.tjjg22 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中三年级'">
                {{ item.tjjg23 }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中四年级'">
                {{ item.tjjg24 }}
              </td>

            </tr>

            <!-- 其他体检指标 -->
            <tr v-for="(item, index) in selsche1.others" :key="index">
              <td colspan="6" class="tablecenter ">
                {{ item.text }}
              </td>
              <template v-if="item.text == '既往病史' || item.text == '体检项目'">
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学一年级'">
                  {{ item.tjjg11 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学二年级'">
                  {{ item.tjjg12 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学三年级'">
                  {{ item.tjjg13 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学四年级'">
                  {{ item.tjjg14 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学五年级'">
                  {{ item.tjjg15 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学六年级'">
                  {{ item.tjjg16 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中一年级'">
                  {{ item.tjjg31 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中二年级'">
                  {{ item.tjjg32 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中三年级'">
                  {{ item.tjjg33 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中一年级'">
                  {{ item.tjjg21 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中二年级'">
                  {{ item.tjjg22 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中三年级'">
                  {{ item.tjjg23 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中四年级'">
                  {{ item.tjjg24 }}
                </td>
              </template>
              <template v-else>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学一年级'">
                  {{ item.tjjg11 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学二年级'">
                  {{ item.tjjg12 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学三年级'">
                  {{ item.tjjg13 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学四年级'">
                  {{ item.tjjg14 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学五年级'">
                  {{ item.tjjg15 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学六年级'">
                  {{ item.tjjg16 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中一年级'">
                  {{ item.tjjg31 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中二年级'">
                  {{ item.tjjg32 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中三年级'">
                  {{ item.tjjg33 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中一年级'">
                  {{ item.tjjg21 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中二年级'">
                  {{ item.tjjg22 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中三年级'">
                  {{ item.tjjg23 }}
                </td>
                <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中四年级'">
                  {{ item.tjjg24 }}
                </td>
                <!-- <td colspan="4" class="tablecenter">{{ item.tjjg2  }}</td>
                      <td colspan="4" class="tablecenter">{{ item.tjjg3  }}</td> -->
              </template>
            </tr>
            <tr>
              <td colspan="6" class="tablecenter ">体检机构</td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学一年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg11
                    ? selsche1.base[0].jg11
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学二年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg12
                    ? selsche1.base[0].jg12
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学三年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg13
                    ? selsche1.base[0].jg13
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学四年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg14
                    ? selsche1.base[0].jg14
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学五年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg15
                    ? selsche1.base[0].jg15
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '小学六年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg16
                    ? selsche1.base[0].jg16
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中一年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg21
                    ? selsche1.base[0].jg21
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中二年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg22
                    ? selsche1.base[0].jg22
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中三年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg23
                    ? selsche1.base[0].jg23
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '初中四年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg24
                    ? selsche1.base[0].jg24
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中一年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg31
                    ? selsche1.base[0].jg31
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中二年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg32
                    ? selsche1.base[0].jg32
                    : ''
                }}
              </td>
              <td colspan="12" class="tablecenter whitebold" v-if="njdata == '高中三年级'">
                {{
                  selsche1.base[0] && selsche1.base[0].jg33
                    ? selsche1.base[0].jg33
                    : ''
                }}
              </td>
              <!-- <td colspan="4" class="tablecenter">{{ selsche1.base[0]&&selsche1.base[0].jg2?selsche1.base[0].jg2:'' }}</td>
                    <td colspan="4" class="tablecenter">{{ selsche1.base[0]&&selsche1.base[0].jg3?selsche1.base[0].jg3:'' }}</td> -->
            </tr>
            <!-- <tr>
                    <td colspan="6" class="tablecenter">既往病史</td>
                    <td colspan="12" class="tablecenter"></td>
                  </tr>
                  <tr>
                    <td colspan="6" class="tablecenter">体检机构</td>
                    <td colspan="12" class="tablecenter"></td>
                  </tr> -->
          </table>

          <div class="printPagenext" style="page-break-after:always"></div>
        </div>
        <!-- 大指标没有数据判断 -->
        <div class="bigZ" v-if="!item.json">
          <div class="mimang" v-for="(ele, ind) in item.children" :key="ele.id">
            <h3 style="font-size: 18px;margin-top:30px !important">
              {{
                item.name == '学业发展'
                  ? ind + 2
                  : item.name == '身心发展'
                    ? ind + 3
                    : ind + 1
              }}.{{ ele.name || '' }}
            </h3>
            <!-- 特殊判断研究性学习 -->
            <table ref="" v-if="ele.name == '研究性学习'" class="basetable"
              style="width:100%; border-collapse:collapse;border: 1px solid #6d6c6c;table-layout:fixed;margin-bottom:10px;height: 100%;">
              <!-- 研究性学习表格内容省略 -->
              <tr>
                <td colspan="4" :class=" isMobile ? 'tablecenter' : 'tablecenter width100'">报告题目</td>
                <td colspan="16" class="tableleft whitebold">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[0] &&
                      ele.evalrecords[0][3] &&
                      ele.evalrecords[0][3]
                      ? ele.evalrecords[0][3]
                      : ''
                  }}
                </td>
              </tr>
              <tr>
                <td colspan="4" class="tablecenter ">指导教师</td>
                <td colspan="6" class="tableleft whitebold">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[0] &&
                      ele.evalrecords[0][0] &&
                      ele.evalrecords[0][0]
                      ? ele.evalrecords[0][0]
                      : ''
                  }}
                </td>
                <td colspan="4" class="tablecenter ">成果形式</td>
                <td colspan="6" class="tableleft whitebold">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[0] &&
                      ele.evalrecords[0][6] &&
                      ele.evalrecords[0][6]
                      ? ele.evalrecords[0][6]
                      : ''
                  }}
                </td>
              </tr>
              <tr>
                <td colspan="4" class="tablecenter ">组内分工</td>
                <td colspan="3" class="tableleft ">
                  负责人:<span style="font-weight:bold;">
                    {{
                      ele.evalrecords &&
                        ele.evalrecords[0] &&
                        ele.evalrecords[0][1] &&
                        ele.evalrecords[0][1]
                        ? ele.evalrecords[0][1]
                        : ''
                    }}
                  </span>
                </td>
                <td colspan="3" class="tableleft ">
                  参与者:<span style="font-weight:bold;">
                    {{
                      ele.evalrecords &&
                        ele.evalrecords[0] &&
                        ele.evalrecords[0][2] &&
                        ele.evalrecords[0][2]
                        ? ele.evalrecords[0][2]
                        : ''
                    }}
                  </span>
                </td>
                <td colspan="4" class="tablecenter ">研究时间</td>
                <td colspan="6" class="tableleft whitebold">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[0] &&
                      ele.evalrecords[0][4] &&
                      ele.evalrecords[0][4]
                      ? ele.evalrecords[0][4]
                      : ''
                  }}
                </td>
              </tr>
              <tr>
                <td colspan="20" class="tableleft"
                  style="height:300px;min-height:300px;padding-top:10px;vertical-align:baseline;">
                  <span class="tablecenter ">研究的内容、方法、过程和结论（500字以内）:</span>
                  <span style="font-weight:bold;">
                    {{
                      ele.evalrecords &&
                        ele.evalrecords[0] &&
                        ele.evalrecords[0][5] &&
                        ele.evalrecords[0][5]
                        ? ele.evalrecords[0][5]
                        : ''
                    }}
                  </span>
                </td>
              </tr>
            </table>

            <table ref="" v-else class="basetable"
              style="width:100%; border-collapse:collapse;border: 1px solid #6d6c6c;table-layout:fixed;margin-bottom:10px;height: 100%;">
              <tr>
                <td colspan="2" class="tablecenter width200" style="width:70px;">
                  序号
                </td>
                <td :colspan="value.lable.length == 1
                  ? 2
                  : value.lable.length == 2
                    ? 4
                    : value.lable.length == 3
                      ? 6
                      : value.lable.length == 4
                        ? 8
                        : 10
                  " class="tablecenter " v-for="(value, index) in JSON.parse(ele.json)" :key="index" :style="value.lable == '学期' ? 'width:215px !important;' : ''
                    ">
                  {{ value.lable }}
                </td>
              </tr>
              <tr>
                <td colspan="2" class="tablecenter whitebold width200" style="width:70px;">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[0] &&
                      ele.evalrecords[0][index] &&
                      ele.evalrecords[0][index]
                      ? 1
                      : ''
                  }}
                </td>
                <td :colspan="value.lable.length == 1
                  ? 2
                  : value.lable.length == 2
                    ? 4
                    : value.lable.length == 3
                      ? 6
                      : value.lable.length == 4
                        ? 8
                        : 10
                  " class="tablecenter whitebold evalrecords_box" v-for="(value, index) in JSON.parse(ele.json)"
                  :key="index">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[0] &&
                      ele.evalrecords[0][index] &&
                      ele.evalrecords[0][index]
                      ? ele.evalrecords[0][index]
                      : ''
                  }}
                </td>
              </tr>
              <tr>
                <td colspan="2" class="tablecenter whitebold width200" style="width:70px;">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[1] &&
                      ele.evalrecords[1][index] &&
                      ele.evalrecords[1][index]
                      ? 2
                      : ''
                  }}
                </td>
                <td :colspan="value.lable.length == 1
                  ? 2
                  : value.lable.length == 2
                    ? 4
                    : value.lable.length == 3
                      ? 6
                      : value.lable.length == 4
                        ? 8
                        : 10
                  " class="tablecenter whitebold evalrecords_box" v-for="(value, index) in JSON.parse(ele.json)"
                  :key="index">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[1] &&
                      ele.evalrecords[1][index] &&
                      ele.evalrecords[1][index]
                      ? ele.evalrecords[1][index]
                      : ''
                  }}
                </td>
              </tr>
              <tr>
                <td colspan="2" class="tablecenter whitebold width200" style="width:70px;">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[2] &&
                      ele.evalrecords[2][index] &&
                      ele.evalrecords[2][index]
                      ? 3
                      : ''
                  }}
                </td>
                <td :colspan="value.lable.length == 1 ? 2
                  : value.lable.length == 2
                    ? 4
                    : value.lable.length == 3
                      ? 6
                      : value.lable.length == 4
                        ? 8
                        : 10
                  " class="tablecenter whitebold evalrecords_box" v-for="(value, index) in JSON.parse(ele.json)"
                  :key="index">
                  {{
                    ele.evalrecords &&
                      ele.evalrecords[2] &&
                      ele.evalrecords[2][index] &&
                      ele.evalrecords[2][index]
                      ? ele.evalrecords[2][index]
                      : ''
                  }}
                </td>
              </tr>

            </table>


            <p v-html="ele.introduction"></p>
          </div>
        </div>
        <!-- 大指标有数据判断 -->
        <div class="bigZ" v-if="item.json">
          <table ref="" class="basetable" style="width:100%; border-collapse:collapse;
                border: 1px solid #6d6c6c;table-layout:fixed;margin-bottom:10px;height: 100%;">
            <tr>
              <td colspan="2" class="tablecenter width200" style="width:70px;">
                序号
              </td>
              <td :colspan="value.lable.length == 1
                ? 2
                : value.lable.length == 2
                  ? 4
                  : value.lable.length == 3
                    ? 6
                    : value.lable.length == 4
                      ? 8
                      : 10
                " class="tablecenter " v-for="(value, index) in JSON.parse(item.json)" :key="index" :style="value.lable == '学期' ? 'width:215px !important;' : ''
                  ">
                {{ value.lable }}
              </td>
            </tr>
            <tr>
              <td colspan="2" class="tablecenter whitebold width200" style="width:70px;">
                {{
                  item.evalrecords &&
                    item.evalrecords[0] &&
                    item.evalrecords[0][0] &&
                    item.evalrecords[0][0]
                    ? 1
                    : ''
                }}
              </td>
              <td :colspan="value.lable.length == 1
                ? 2
                : value.lable.length == 2
                  ? 4
                  : value.lable.length == 3
                    ? 6
                    : value.lable.length == 4
                      ? 8
                      : 10
                " class="tablecenter whitebold evalrecords_box" v-for="(value, index) in JSON.parse(item.json)"
                :key="index">
                {{
                  item.evalrecords &&
                    item.evalrecords[0] &&
                    item.evalrecords[0][index] &&
                    item.evalrecords[0][index]
                    ? item.evalrecords[0][index]
                    : ''
                }}
              </td>
            </tr>
            <tr>
              <td colspan="2" class="tablecenter whitebold width200" style="width:70px;">
                {{
                  item.evalrecords &&
                    item.evalrecords[1] &&
                    item.evalrecords[1][1] &&
                    item.evalrecords[1][1]
                    ? 2
                    : ''
                }}
              </td>
              <td :colspan="value.lable.length == 1
                ? 2
                : value.lable.length == 2
                  ? 4
                  : value.lable.length == 3
                    ? 6
                    : value.lable.length == 4
                      ? 8
                      : 10
                " class="tablecenter whitebold evalrecords_box" v-for="(value, index) in JSON.parse(item.json)"
                :key="index">
                {{
                  item.evalrecords &&
                    item.evalrecords[1] &&
                    item.evalrecords[1][index] &&
                    item.evalrecords[1][index]
                    ? item.evalrecords[1][index]
                    : ''
                }}
              </td>
            </tr>
            <tr>
              <td colspan="2" class="tablecenter whitebold width200" style="width:70px;">
                {{
                  item.evalrecords &&
                    item.evalrecords[2] &&
                    item.evalrecords[2][2] &&
                    item.evalrecords[2][2]
                    ? 3
                    : ''
                }}
              </td>
              <td :colspan="value.lable.length == 1
                ? 2
                : value.lable.length == 2
                  ? 4
                  : value.lable.length == 3
                    ? 6
                    : value.lable.length == 4
                      ? 8
                      : 10
                " class="tablecenter whitebold evalrecords_box" v-for="(value, index) in JSON.parse(item.json)"
                :key="index">
                {{
                  item.evalrecords &&
                    item.evalrecords[2] &&
                    item.evalrecords[2][index] &&
                    item.evalrecords[2][index]
                    ? item.evalrecords[2][index]
                    : ''
                }}
              </td>
            </tr>
          </table>

          <p v-html="item.introduction"></p>
        </div>
      </div>
    </div>

    <span id="dialog-footer">
      <el-button size="big" @click="handlePrint">打印</el-button>
      <el-button size="big" type="primary" @click="semereport_show = false">确定</el-button>
    </span>
  </div>
</template>

<script setup>
import { ref, watch, defineProps, defineEmits, reactive } from 'vue'
import { ElMessageBox } from 'element-plus'
import { useStore } from "@/store";
const store = useStore();
const homeStore = store.home;

// Props
let props = defineProps({
  visible: {
    type: Boolean,
    default: false
  },
  listrow: {
    type: Object,
    default: () => ({})
  }
})



// Emits
let emit = defineEmits(['update:visible'])

// 数据定义
let bzfData = reactive({ bzf: '' })
let maodianIndex = ref(0)
let maodianList = reactive([{ name: '基本信息', id: '1', href: '#mao1' }])
let njdata = ref('')
let myself = reactive({
  familycon: [],
  resumecon: [],
  cevaluation: '',
  statement: '',
  yidong: []
})
let listrow = ref({})
let semereport_show = ref(false)
let title = ref('')
let imgurl = ref('')
let imgshow = ref(false)
let newDta = ref([])
let allsem = ref([])
let table6 = ref([])
let testing = ref([])
let selsche1 = reactive({ base: [], others: [] })
let xnzf = reactive({})
let km = ref({})
let shuoming = reactive({})
let projectsTab1 = reactive([]) //体测男生
let projectsTab2 = reactive([]) //体测女生
let activeData = reactive([])//参加活动情况
let activeData1 = reactive([])//参加活动情况数据
let xianjin = reactive([])  //先进个人荣誉指标
let xianjin1 = reactive([]) //先进个人荣誉数据
let sportsData = reactive([]) //参加体育活动情况指标
let sportsData1 = reactive([]) //参加体育活动情况数据
let tiyuData = reactive([]) //体育特长指标
let tiyuData1 = reactive([]) //体育特长数据
let heartdata = reactive([])//心里素质展示指标
let heartdata1 = reactive([]) //心里素质展示数据
let yishuactive = reactive([])//艺术素养展示指标
let yishuactive1 = reactive([]) //艺术素养展示数据
let yishutechang = reactive([]) //艺术特长指标
let yishutechang1 = reactive([]) //艺术特长数据
let shehui = reactive([])  //社会实践指标
let shehui1 = reactive([])  //社会实践数据
let reportData = reactive([])  //研究性学习数据
let objectdata = reactive([])  //学科特长指标
let objectdata1 = reactive([]) //学科特长数据


// 检测是否为移动设备
const isMobile = ref(false);

const checkDeviceType = () => {
  const width = window.innerWidth;
  isMobile.value = width < 768; // 768px为断点
};


// 本地抽屉状态
let drawer = ref(true)
let direction = ref('rtl') // 从右到左滑出

// 监听visible属性变化，同步到本地drawer状态
watch(() => props.visible, (newVal) => {
  drawer.value = newVal
})


let itemsXQData = ref([])
let itemsXQCKData = ref([])
const tabList = () => {
  itemsXQData.value.forEach((item, index) => {
    maodianList.push({
      name: item.name,
      id: index + 2,
      href: '#' + 'mao' + JSON.stringify(index + 2)
    })
  })
  // 处理数据,拿出有指标采集项的指标数据
  newDta.value.forEach(ele => {
    var new_arr = []
    if (ele.children.length > 0) {
      new_arr = ele.children.filter(elem => {
        if (elem.json) {
          return JSON.parse(elem.json).length > 0
        }
      })
      ele.children = new_arr
    }
    if (ele.json) {
      // ele.json=JSON.parse(ele.json)
    }
  })
  // 处理指标数据
  newDta.value.forEach((lis, index) => {
    if (lis.children.length > 0) {
      lis.children.forEach((e, i) => {
        if (e.evalrecords && JSON.parse(e.evalrecords)) {
          var newDta1 = []
          newDta1 = GetDataZbnew(e.evalrecords)
          e.evalrecords = newDta1
        }
      })
    }
    // 当大指标没有子节点,只有自己一个数据
    if (lis.evalrecords) {
      var newDta1 = []
      newDta1 = GetDataZbnew(lis.evalrecords)
      lis.evalrecords = newDta1
    }
  })

  // 获取学期评价指标
  itemsXQCKData.value = homeStore.getItemXQCK
  console.log(itemsXQCKData.value.code, 'itemsXQCKData.value')
  let res = itemsXQCKData.value
  if (res.code === 1) {
    myself = {
      ...myself,
      ...res.data.table1[0],
    }
    console.log(myself)
    myself.mz = getma('ZD_GB_MZM', myself.mzm)
    myself.zzmm = getma('ZD_BB_ZZMMM', myself.zzmmm)
    myself.sfzjlx = getma(
      'ZD_BB_SFZJLXM',
      myself.sfzjlxm
    )
    myself.gjdq = getma('ZD_GB_GJDQM', myself.gjdqm)
    myself.gatqw = getma('ZD_BB_GATQWM', myself.gatqwm)
    myself.sflset = getma(
      'ZD_BB_SFLSETM',
      myself.sflsetm
    )
    myself.cjlx = getma('ZD_BB_CJLXM', myself.cjlxm)
    myself.rxfs = getma('ZD_BB_RXFSM', myself.rxfsm)

    // 家庭成员
    if (myself.familycon) {
      myself.familycon = JSON.parse(myself.familycon)
      myself.familycon.forEach(item => {
        if (item.GXM) {
          item.GXM = getma('ZD_BB_GXM', item.GXM)
        }
        if (item.MZM) {
          item.MZM = getma('ZD_GB_MZM', item.MZM)
        }
        if (item.SFZJLXM) {
          item.SFZJLXM = getma('ZD_BB_SFZJLXM', item.SFZJLXM)
        }
        if (item.SFJHRM) {
          item.SFJHRM = getma('SFM', item.SFJHRM)
        }
      })
    } else {
      myself.familycon = []
    }
    // 学习简历
    if (myself.resumecon) {
      myself.resumecon = JSON.parse(myself.resumecon)
    } else {
      myself.resumecon = []
    }
    // 异动信息
    myself.yidong = res.data.table10
    // 自我介绍,综合评语
    myself.statement = res.data.table4[0]?.statement
      ? res.data.table4[0].statement
      : ''
    myself.cevaluation = res.data.table4[0]?.cevaluation
      ? res.data.table4[0].cevaluation
      : ''

    // 所有科目以及成绩学业水平
    if (res.data.table5[0]) {
      allsem = res.data.table5[0]
      if (njdata == '小学一年级') {
        allsem.score211 = JSON.parse(allsem.score111)
        allsem.score212 = JSON.parse(allsem.score112)
      } else if (njdata == '小学二年级') {
        allsem.score211 = JSON.parse(allsem.score121)
        allsem.score212 = JSON.parse(allsem.score122)
      } else if (njdata == '小学三年级') {
        allsem.score211 = JSON.parse(allsem.score131)
        allsem.score212 = JSON.parse(allsem.score132)
      } else if (njdata == '小学四年级') {
        allsem.score211 = JSON.parse(allsem.score141)
        allsem.score212 = JSON.parse(allsem.score142)
      } else if (njdata == '小学五年级') {
        allsem.score211 = JSON.parse(allsem.score151)
        allsem.score212 = JSON.parse(allsem.score152)
      } else if (njdata == '小学六年级') {
        allsem.score211 = JSON.parse(allsem.score161)
        allsem.score212 = JSON.parse(allsem.score162)
      } else if (njdata == '初中一年级') {
        allsem.score211 = JSON.parse(allsem.score211)
        allsem.score212 = JSON.parse(allsem.score212)
      } else if (njdata == '初中二年级') {
        allsem.score211 = JSON.parse(allsem.score221)
        allsem.score212 = JSON.parse(allsem.score222)
      } else if (njdata == '初中三年级') {
        allsem.score211 = JSON.parse(allsem.score231)
        allsem.score212 = JSON.parse(allsem.score232)
      } else if (njdata == '初中四年级') {
        allsem.score211 = JSON.parse(allsem.score241)
        allsem.score212 = JSON.parse(allsem.score242)
      } else if (njdata == '高中一年级') {
        allsem.score211 = JSON.parse(allsem.score311)
        allsem.score212 = JSON.parse(allsem.score312)
      } else if (njdata == '高中二年级') {
        allsem.score211 = JSON.parse(allsem.score321)
        allsem.score212 = JSON.parse(allsem.score322)
      } else if (njdata == '高中三年级') {
        allsem.score211 = JSON.parse(allsem.score331)
        allsem.score212 = JSON.parse(allsem.score332)
      } else {
        allsem.score211 = []
        allsem.score212 = []
      }
    } else {
      allsem = []
    }


    // 身心健康健康标准卡 体测
    if (res.data.table6.length > 0) {
      if (myself.xbm == 1) {
        table6 = res.data.table6.filter(ql => {
          return ql.syxb == '1' || ql.syxb == '0' || ql.syxb == null
        })
      } else {
        table6 = res.data.table6.filter(ql => {
          return ql.syxb == '2' || ql.syxb == '0' || ql.syxb == null
        })
      }
    } else {
      if (myself.xbm == 1) {
        table6 = projectsTab1
      } else {
        table6 = projectsTab2
      }
    }
    // 加分指标项
    if (res.data.table7.length > 0) {
      if (myself.xbm == 1) {
        res.data.table7 = res.data.table7.filter(
          item => item.syxb == 1 || item.syxb == 0 || item.syxb == null
        )
      } else if (myself.xbm == 2) {
        res.data.table7 = res.data.table7.filter(
          item => item.syxb == 2 || item.syxb == 0 || item.syxb == null
        )
      }
      testing = res.data.table7
    } else {
      if (myself.xbm == 1) {
        // testing = projectsTab3
      } else {
        // testing = projectsTab4
      }
    }
    bzfData.bzf = ''

    // 学年总分，等级评定
    if (res.data.table8.length > 0) {
      res.data.table8.forEach(value => {
        if (value.xndj == 1) {
          value.xndj = '优秀'
        } else if (value.xndj == 2) {
          value.xndj = '良好'
        } else if (value.xndj == 3) {
          value.xndj = '及格'
        } else if (value.xndj == 4) {
          value.xndj = '不及格'
        }
        if (row.nj == value.nj) {
          xnzf.xnzf = value.xnzf
          xnzf.xndj = value.xndj
          bzfData.bzf = value.bzf
        } else {
          // xnzf.xnzf =''
          // xnzf.xndj =''
        }
      })
    } else {
      xnzf.xnzf = ''
      xnzf.xndj = ''
    }

    // 体检指标
    if (res.data.table9.length > 0) {
      res.data.table9.forEach(ele => {
        if (ele.text == '既往病史') {
          ele.code = 100
        }
        if (
          ele.text == '左眼裸眼视力' ||
          ele.text == '右眼裸眼视力' ||
          ele.text == '左眼近视视力' ||
          ele.text == '右眼近视视力'
        ) {
          ele.code = 6
        }
      })
      res.data.table9 = res.data.table9.filter(
        item => item.text !== '视力'
      )
      res.data.table9 = res.data.table9.filter(
        item => item.text !== '体检项目'
      )
      res.data.table9 = res.data.table9.sort((a, b) => {
        return a.code - b.code
      })
      selsche1.base = res.data.table9.slice(0, 6)
      selsche1.others = res.data.table9.slice(
        6,
        res.data.table9.length
      )
    } else {
      selsche1.base = selsche.base
      selsche1.others = selsche.others
    }

    // 视力指标


    //  全部指标配置
    // table2是所有数据
    // table12是所有指标的配置项
    if (res.data.table11.length > 0) {
      res.data.table11.forEach(ele => {
        if (ele.code == 'ZB0101') {
          shuoming.data1 = ele.introduction //参加活动情况
        } else if (ele.code == 'ZB0104') {
          shuoming.data2 = ele.introduction //先进个人荣誉
        } else if (ele.code == 'ZB03') {
          shuoming.data3 = ele.introduction //学业水平
        } else if (ele.code == 'ZB0305') {
          shuoming.data4 = ele.introduction //研究型学习
        } else if (ele.code == 'ZB0306') {
          shuoming.data5 = ele.introduction //学科特长
        } else if (ele.code == 'ZB04') {
          shuoming.data6 = ele.introduction //身心健康
        } else if (ele.code == 'ZB0401') {
          shuoming.data7 = ele.introduction //参加体育活动情况
        } else if (ele.code == 'ZB0403') {
          shuoming.data8 = ele.introduction //体育特长
        } else if (ele.code == 'ZB0402') {
          shuoming.data9 = ele.introduction //心理素质展示
        } else if (ele.code == 'ZB0501') {
          shuoming.data10 = ele.introduction //参加艺术活动情况
        } else if (ele.code == 'ZB0503') {
          shuoming.data11 = ele.introduction //艺术特长
        } else if (ele.code == 'ZB0601') {
          shuoming.data12 = ele.introduction //社会实践
        }
      })
      let dataRes = res.data.table11
      // 重置数据
      activeData = []
      xianjin = []
      sportsData = []
      tiyuData = []
      heartdata = []
      yishuactive = []
      yishutechang = []
      shehui = []
      objectdata = []

      activeData = getZBpzXQ('ZB0101', dataRes) //思想品德 参加活动情况
      xianjin = getZBpz('ZB0104', dataRes) // 思想品德，先进个人荣誉
      sportsData = getZBpzXQ('ZB0401', dataRes) //参加体育活动情况
      tiyuData = getZBpz('ZB0403', dataRes) //体育特长也叫运动特长
      heartdata = getZBpz('ZB0402', dataRes) //心里素质展示
      yishuactive = getZBpzXQ('ZB0501', dataRes) //艺术活动
      yishutechang = getZBpz('ZB0503', dataRes) //艺术特长
      shehui = getZBpz('ZB0601', dataRes) //社会实践
      objectdata = getZBpz('ZB0306', dataRes) //学科特长指标
    } else {
    }

    // 获取数据table2
    if (res.data.table2.length > 0) {
      // 重置数据
      activeData1 = []
      xianjin1 = []
      sportsData1 = []
      tiyuData1 = []
      heartdata1 = []
      yishuactive1 = []
      yishutechang1 = []
      shehui1 = []
      reportData = []
      objectdata1 = []
      // 1.参加活动情况数据
      activeData1 = res.data.table2.filter(item => {
        return (
          item.code == 'ZB0101' ||
          item.code == 'ZB0102' ||
          item.code == 'ZB0103' ||
          item.code == 'ZB0105'
        )
      })
      if (activeData1.length > 0) {
        activeData1 = GetDataZbXq(activeData1)
      } else {
        activeData1 = []
      }

      // 2,先进个人荣誉情况
      xianjin1 = res.data.table2.filter(item => {
        return item.code == 'ZB0104'
      })
      if (xianjin1.length > 0) {
        xianjin1 = GetDataZb(xianjin1)
      } else {
        xianjin1 = []
      }
      // 参加体育活动情况
      sportsData1 = res.data.table2.filter(item => {
        return item.code == 'ZB0401'
      })
      if (sportsData1.length > 0) {
        sportsData1 = GetDataZbXq(sportsData1)
      } else {
        sportsData1 = []
      }
      // 体育特长
      tiyuData1 = res.data.table2.filter(item => {
        return item.code == 'ZB0403'
      })
      if (tiyuData1.length > 0) {
        tiyuData1 = GetDataZb(tiyuData1)
      } else {
        tiyuData1 = []
      }
      //  心理素质展示
      heartdata1 = res.data.table2.filter(item => {
        return item.code == 'ZB0402'
      })
      if (heartdata1.length > 0) {
        heartdata1 = GetDataZb(heartdata1)
      } else {
        heartdata1 = []
      }
      // 参加艺术活动情况
      yishuactive1 = res.data.table2.filter(item => {
        return item.code == 'ZB0501'
      })
      if (yishuactive1.length > 0) {
        yishuactive1 = GetDataZbXq(yishuactive1)
      }
      // 艺术特长
      yishutechang1 = res.data.table2.filter(item => {
        return item.code == 'ZB0503'
      })
      if (yishutechang1.length > 0) {
        yishutechang1 = GetDataZb(yishutechang1)
      } else {
        yishutechang1 = []
      }
      // 社会实践
      shehui1 = res.data.table2.filter(item => {
        return item.code == 'ZB0601'
      })
      if (shehui1.length > 0) {
        shehui1 = GetDataZb(shehui1)
      } else {
        shehui1 = []
      }
      // 研究性学习数据
      reportData = res.data.table2.filter(item => {
        return item.code == 'ZB0305'
      })
      if (reportData.length > 0) {
        reportData = GetDataZb(reportData)
      } else {
        reportData = []
      }
      // 学科特长
      objectdata1 = res.data.table2.filter(item => {
        return item.code == 'ZB0306'
      })
      if (objectdata1.length > 0) {
        objectdata1 = GetDataZb(objectdata1)
      } else {
        objectdata1 = []
      }
    } else {
      activeData1 = []
      xianjin1 = []
      sportsData1 = []
      tiyuData1 = []
      heartdata1 = []
      yishuactive1 = []
      yishutechang1 = []
      shehui1 = []
      reportData = []
      objectdata1 = []
    }
  }
}

// 获取所有科目信息
const getkm = () => {
  km = {}
  km = $store.getters.code.tree[
    $store.getters.code['KSKMDM'].id
  ].children
    .sort(sortByOrderno)
    .map(row => {
      if (['DL', 'SW', 'MUS', 'MS', 'ZP'].includes(row.code)) {
        return {
          CODE: row.code,
          TEXT: row.text,
          type: 1
        }
      }
      return { CODE: row.code, TEXT: row.text, type: 0 }
    })
}
//获取所有体测项目
const GetIndictor = () => {
  // request({
  //   async: true,
  //   url: 'Sports/GetIndictor',
  //   method: 'get'
  // }).then(res => {
  //   projectsTab1 = res.filter(el => el.xbm == '1' && el.sfjf != 1)
  //   projectsTab2 = res.filter(el => el.xbm == '2' && el.sfjf != 1)
  //   projectsTab3 = res.filter(el => el.xbm == '1' && el.sfjf == 1)
  //   projectsTab4 = res.filter(el => el.xbm == '2' && el.sfjf == 1)
  // })
}





// 获取指标配置项函数中间插入学期
const getZBpzXQ = (code, res) => {
  let data = []
  data = res.filter(item => {
    return item.code == code
  })
  data.splice(2, 0, { lable: '学期' })
  return data
}
// 获取指标配置项函数
const getZBpz = (code, res) => {
  let data = []
  data = res.filter(item => {
    return item.code == code
  })
  return data
}

//得到指标数据带学期函数
const GetDataZbXq = (data) => {
  let arrdata = []
  let data1 = JSON.parse(JSON.stringify(data))
  data.forEach((item, index) => {
    item.evalrecord = JSON.parse(item.evalrecord)
    let array = []
    for (var key in item.evalrecord) {
      array.push(item.evalrecord[key])
    }
    array.splice(2, 0, item.semestername)
    arrdata.push(array)
  })
  data1 = arrdata
  return data1
}

const GetDataZbnew = (data) => {
  let array = []
  JSON.parse(data).forEach(rlr => {
    var datane = []
    for (var key in rlr) {
      datane.push(rlr[key])
    }
    array.push(datane)
  })
  return array
}

const GetDataZb = (data) => {
  let arrdata = []
  let data1 = JSON.parse(JSON.stringify(data))
  data.forEach((item, index) => {
    item.evalrecord = JSON.parse(item.evalrecord)
    let array = []
    for (var key in item.evalrecord) {
      array.push(item.evalrecord[key])
    }
    arrdata.push(array)
  })
  data1 = arrdata
  return data1
}

// 监听drawer状态变化，同步回父组件
watch(drawer, (newVal) => {
  emit('update:visible', newVal)
})

// 处理关闭事件
let handleClose = (done) => {
  ElMessageBox.confirm('确定关闭此窗口吗？')
    .then(() => {
      done()
    })
}

// 打印功能
let handlePrint = () => {
  try {
    // 创建一个新窗口用于打印
    const printWindow = window.open('', '_blank');

    // 获取综合素质发展记录部分的内容
    const contentElement = document.querySelector('#mao2'); // 这是综合素质发展记录的锚点
    const contentToPrint = contentElement ? contentElement.parentElement.innerHTML : '';

    if (!contentToPrint) {
      ElMessageBox.alert('未找到需要打印的内容，请检查页面结构');
      return;
    }

    // 构建打印内容，包含必要的样式
    const printContent = `
      <html>
        <head>
          <title>学生发展质量报告 - 综合素质发展记录</title>
          <style>
            body {
              font-family: Arial, sans-serif;
              font-size: 12pt;
              line-height: 1.5;
            }
            h2, h3 {
              color: #000;
              font-weight: bold;
            }
            table {
              width: 100%;
              border-collapse: collapse;
              margin-bottom: 10px;
              font-size: 10pt;
            }
            th, td {
              border: 1px solid #000;
              padding: 4px;
              text-align: center;
            }
            @page {
              size: A4;
              margin: 1.5cm;
            }
          </style>
        </head>
        <body>
          ${contentToPrint}
        </body>
      </html>
    `;

    // 在新窗口中写入内容并打印
    printWindow.document.open();
    printWindow.document.write(printContent);
    printWindow.document.close();

    // 当文档加载完成后执行打印
    printWindow.onload = () => {
      printWindow.print();
      printWindow.close();
    };
  } catch (e) {
    console.error('打印失败:', e);
    ElMessageBox.alert('打印失败，请稍后再试');
  }
}

let semereport = ref(null)
let printshuiyin = ref(null)


let selectedYear = ref('');
let optionsYear = reactive([])
let student_id = ref('');

// 方法定义
let clickMaodain = (index) => {
  maodianIndex.value = index

  // 获取对应锚点的href
  const href = maodianList[index].href

  // 移除href中的'#'符号，获取锚点ID
  const anchorId = href.substring(1)

  // 查找对应的DOM元素
  const element = document.getElementById(anchorId)

  // 如果找到元素，则滚动到该元素
  if (element) {
    // 阻止默认的锚点跳转行为
    event.preventDefault()

    // 平滑滚动到目标元素
    element.scrollIntoView({
      behavior: 'smooth',
      block: 'start'
    })
  } else {
    console.warn(`未找到ID为${anchorId}的锚点元素`)
  }
}



let dictCodeInfo = ref([])

let getma = async (data, data1) => {
  if (data1) {
    dictCodeInfo.value.filter(item => {
      if (item.dictype == data && item.code == data1) {
        return item.text
      } else {
        return ''
      }
    })
  } else {
    return ''
  }
}


onMounted(async () => {
    // 检测设备类型
  checkDeviceType();
  window.addEventListener('resize', checkDeviceType);

  // 微代码赋值
  await homeStore.getDictCodeData()
  dictCodeInfo.value = homeStore.getDictCodeInfo
  //学期赋值
  optionsYear = toRaw(homeStore.semesterInfo)
  selectedYear.value = optionsYear[0].SEMESTER_ID
  // 学期评价和综合评价用到的数据
  await homeStore.getTermPJAndSummaryData(selectedYear.value, '2')
  //学期评价
  await homeStore.getTermPJData(selectedYear.value, '2', student_id.value)
  // 强制同步一次状态
  drawer.value = props.visible
  itemsXQData.value = homeStore.getItemXQ
  newDta.value = homeStore.getItemXQ
  tabList()
  GetIndictor()
})

onUnmounted(() => {
  window.removeEventListener('resize', checkDeviceType);
});
</script>

<style scoped lang="scss">
.maodian {
  position: absolute;
  background-color: white;
  height: 44px;
  width: 92%;
  z-index: 999;
  margin-top: 0px;
}

.maoa {
  display: inline-block;
  margin-left: 0px;
  font-size: 16px;
  position: relative;
  top: 1px;
  padding-bottom: 10px;
  border: 1px solid #e4e7ed;
  border-bottom: 0px solid #e4e7ed;
  padding: 10px 20px 10px 20px;
  border-bottom: 1px solid #e4e7ed;
  border-left: 0px solid #e4e7ed;
  border-right: 1px solid #e4e7ed;
}

.maoa:hover {
  color: #409eff;
}

.maoaactive {
  display: inline-block;
  margin-left: 0px;
  font-size: 16px;
  padding-bottom: 10px;
  color: #409eff;
  position: relative;
  top: 1px;
  border-bottom: 1px solid #409eff;
  border: 1px solid #e4e7ed;
  border-bottom: 1px solid white;
  padding: 10px 20px 10px 20px;
  border-left: 1px solid #e4e7ed;
  border-right: 0px solid #e4e7ed;
}

.maoaactive:hover {
  color: #409eff;
}


#dialog-footer{
display: flex;
 justify-content: end;
  margin: 20px 0;
 
}


/* 打印样式 */
@media print {

  /* 隐藏不需要打印的元素 */
  .el-drawer__header,
  .el-drawer__close-btn,
  .maodian,
  .maoaactive,
  .maoa,
  .el-dialog__footer {
    display: none !important;
  }
}
</style>


<style lang="scss" scoped>
.semereport {
  width: 100%;
  max-width: 1450px;
  margin: 0 auto;
  padding: 0;

  .el-input-number {
    width: 100%;

    >span {
      display: none;
    }

    input {
      padding-left: 20px;
      text-align: left;
    }
  }

  .el-table__empty-block {
    margin: 0 auto;
  }

  .columinput {
    position: static !important;
    padding: 0 !important;

    .cell {
      padding: 0 !important;
    }

    .el-form-item__error {
      top: 19px;
      z-index: 100000;
      width: 100%;
      text-align: center;
    }
  }
}


.semereport {
  h2 {
    font-weight: 400;
    text-align: center;
    font-size: 22px;
  }

  .flex {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 10px;
    margin-bottom: 10px;
  }
}

#print1 {
  width: 100%;
  max-width: 1450px;
  margin: 0 auto;
  padding: 0;

  .flex {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 10px;
    margin-bottom: 10px;

    .box1 {
      width: 100%;
    }

    .box3 {
      width: 100%;
      text-align: right;
    }
  }
}
</style>



<style lang="scss" scoped>
.semereport {
  .maoa {
    display: inline-block;
    margin-left: 0px;
    font-size: 16px;
    position: relative;
    top: 1px;
    padding-bottom: 10px;
    border: 1px solid #e4e7ed;
    border-bottom: 0px solid #e4e7ed;
    padding: 10px 20px 10px 20px;
    border-bottom: 1px solid #e4e7ed;
    border-left: 1px solid #e4e7ed;
    border-right: 0px solid #e4e7ed;
  }

  .maoa:hover {
    color: #409eff;
  }

  .maoaactive {
    display: inline-block;
    margin-left: 0px;
    font-size: 16px;
    padding-bottom: 10px;
    color: #409eff;
    position: relative;
    top: 1px;
    border-bottom: 1px solid #409eff;
    border: 1px solid #e4e7ed;
    border-bottom: 1px solid white;
    padding: 10px 20px 10px 20px;
    border-left: 1px solid #e4e7ed;
    border-right: 0px solid #e4e7ed;
  }

  .maodian {
    border-bottom: 1px solid #8080802e;
    position: absolute;
    background-color: white;
    height: 44px;
    width: 92%;
    z-index: 999;
    display: none;
  }

  h3 {
    font-weight: 400;
    margin-bottom: 25px;
    margin-top: 44px;
  }

  table {
    .tablecenter {
      text-align: center !important;
    }

    .tableleft {
      text-align: left !important;
    }

    .tableright {
      text-align: right !important;
    }
  }

  .toptable {
    margin-top: 0px !important;
    border-top: 0px solid red !important;

    .trr {
      border-top: 0px solid red !important;
    }

    .tdd {
      border-top: 0px solid red !important;
    }
  }

  .slash-wrap {
    position: relative;
    box-sizing: border-box;
    width: 150px;
    height: 80px;
  }

  .slash {
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    width: 103%;
    height: 1px;
    background-color: #ccc;

    transform: rotate(11.072487deg);
    transform-origin: top left;
  }

  .left {
    position: absolute;
    left: 15px;
    bottom: 3px;
  }

  .right {
    position: absolute;
    /* 右上角 right:0; top: 0; */
    right: 15px;
    top: 3px;
  }
}


.maoaactive:hover {
  color: #409eff;
}

.basetable {
  margin-top: 0px;
}

.endreport {
  .el-dialog__body {
    tr {
      height: 45px !important;
    }
  }
}

// @import '~@/assets/font/font.css';
#print1 {
  font-family: STSong !important;

  // font-family: serif;
  h3,
  h2 {
    // font-family:'SimSun' !important;
    // font-family: serif;
    font-family: STSong;
  }

  .flex {
    // font-family: SimSun;
    font-family: STSong;
    // font-family: serif;
  }

  table {
    td {
      border: 1px solid rgba(0, 0, 0, 0.747) !important;
      font-family: STSong;
      font-size: 17px;
      word-break: break-all;
      text-align: center;
    }

    .tdd {
      border-top: 0px solid white !important;
    }

    .whitebold {
      font-weight: 700;
    }
  }
}

.font18 {
  font-size: 20px;
  margin-top: 30px;
  margin-bottom: 22px !important;
}

.width100 {
  width: 140px;
  height: 50px;
}

.width200 {
  width: 190px;
  height: 50px;
}
</style>
<style lang="scss" scoped>
/* 全局打印样式 */
@media print {

  /* 隐藏不需要打印的元素 */
  .el-drawer__header,
  .el-drawer__close-btn,
  .maodian,
  .maoaactive,
  .maoa,
  .el-dialog__footer {
    display: none !important;
  }

  /* 设置打印页面 */
  @page {
    size: A4;
    margin: 1.5cm;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  /* 确保内容适合A4宽度 */
  .el-dialog {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .el-dialog__body {
    padding: 0 !important;
    max-height: none !important;
  }

  /* 表格适应打印宽度 */
  table {
    width: 100% !important;
    table-layout: auto !important;
    font-size: 10pt !important;
  }

  /* 调整打印字体大小 */
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    page-break-after: avoid;
  }

  /* 确保页面内容不被分割 */
  tr,
  .basetable,
  .toptable {
    page-break-inside: avoid;
  }

  /* 调整打印区域的边距 */
  #print1 {
    width: 100%;
    margin: 0;
    padding: 0;
  }
}

@media (max-width: 768px)  {
  *{
     font-size: 14px !important;
  }
  #print1{
    
    .flex{
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: flex-start;
    }
    h2{
      font-size: 28px;
    }
  }
}

</style>
